import { ActiveBaseIcon } from "../activity/icon/ActiveBaseIcon";
import { LayerManager } from "../../manager/LayerManager";
import { RightTopLayerLine } from "../../manager/RightTopLayerLine";
import { RightTopLayerIndex } from "../../manager/RightTopLayerIndex";
import { Cache } from "../../cache/Cache";
import { LevelLimitDefin } from "../../../common/defin/LevelLimitDefin";
import { EffectManager } from "../../manager/EffectManager";
import { GuideArrowManager } from "../../manager/GuideArrowManager";
import { GuideArrow } from "../guide/GuideArrow";
import { ObjCreate } from "../common/ObjCreate";
import { ResFileConst } from "../../resource/ResFileConst";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
//class Lv70DramaIconBtn
    
    export  class Lv70DramaIconBtn extends ActiveBaseIcon
    {
        constructor()
        {
            super();
            this.layer = LayerManager.rightTopUILayer;
            this.line = RightTopLayerLine.lineTwo;
            this.index = RightTopLayerIndex.Lv70DramaIconBtn;
            this.createChildren();
            this.addListeners();
            return;
        }

        public showEffect(arg1: Boolean): void
        {
            var loc1=null;
            var loc2=null;
            if (Cache.instance.role.entityInfo.level < LevelLimitDefin.Lv70DramaLimitLevel) 
            {
                return;
            }
            if (arg1) 
            {
                loc1 = new Object /* flash.filters.GlowFilter */(268435302, 1, 6, 6, 4);
                loc2 = [loc1];
                EffectManager.glowFilterReg(this._lv70DramaBtn, loc2, 0.8, 10, 5, 0);
            }
            else 
            {
                EffectManager.glowFilterUnReg(this._lv70DramaBtn);
            }
            return;
        }

        public showGuidArrow(arg1: Boolean): void
        {
            if (arg1) 
            {
                this.addChild(this.arrow);
                this.arrow.x = 30;
                this.arrow.y = 60;
            }
            else if (this.arrow.parent == this) 
            {
                GuideArrowManager.hideGuideArrow();
            }
            return;
        }

        /* internal  */get arrow(): GuideArrow
        {
            if (this._arrow == null) 
            {
                this._arrow = GuideArrowManager.getGuideArrow(GuideArrowManager.Dir_T, null, 0);
            }
            return this._arrow;
        }

        /* internal  */createChildren(): void
        {
            this._lv70DramaBtn = ObjCreate.createGLoadedButton(ResFileConst.Lv70DramaEnterBtn, 0, 0, 60, 50, this);
            return;
        }

        /* internal  */addListeners(): void
        {
            this._lv70DramaBtn.addEventListener(flash.events.MouseEvent.CLICK, this.openDramaMapHandler);
            return;
        }

        protected openDramaMapHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.Lv70DramaChooseDrama));
            return;
        }

        /* internal */ /* var */_lv70DramaBtn: GLoadedButton;

        /* internal */ /* var */_arrow: GuideArrow;
    }
